
var mongoose = require("mongoose");
var Schema = mongoose.Schema;
var articleSchema = new Schema({
    title: {
        type: String,
        required: true,
       },
       description: {
        type: String,
        required: true,
       },
       body:{
           type:String,
           required:true
       },
       taglist:{
           type:[String],
           default:null
       },
       favoritesCount:{
           type:Number,
           default:null
       },
       author:{
           type:Schema.Types.ObjectId,
           ref:'User',
        //    required:true
       },
       createAt:{
        type:Date,
        default:Date.now
    },
    updateAt:{
        type:Date,
        default:Date.now
    }
    
  });
  module.exports = articleSchema

